Prepare Interview

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

Java Design Patterns Interview Questions and Answers

Question: What is decorator design pattern in Java?
Answer:
  • Decorator design pattern is used to enhance the functionality of a particular object at run-time or dynamically.
  • At the same time other instance of same class will not be affected by this so individual object gets the new behavior.
  • Basically we wrap the original object through decorator object.
  • Decorator design pattern is based on abstract classes and we derive concrete implementation from that classes,
  • It’s a structural design pattern and most widely used.
Is it helpful? Yes No

Most helpful rated by users:

©2024 WithoutBook